{% if error %}
<h1>Error {{ error }} managing project.</h1>
{% endif %}

<form method="post" action="/admin/project/manage">
{% if project %}
   <input type="hidden" name="project" value="{{project.pk}}"/>
   <h1>Project {{project}}</h1>
   {% if project.user_set.all %}
   <h2>Existing Project Users</h2>
      {% for u in project.user_set.all %}
          <br><label>User {{ u }}</label><input type="checkbox" name="delete_{{ forloop.counter }}" value="{{u}}"/>Delete
      {% endfor %}
      <br><input type="submit" value="Done"/>
   {% else %}
      <br>Sorry, project has no users.
   {% endif %}
   <h2>Create New Project User</h2>
      <br><label>New user name</label> <input type="text" name="new_user"/>
      <br><input type="submit" value="Done"/>
   <h2>Add User to Project</h2>
      <br><label>Pick a user to add</label>
      <select name="existing_user">
        <option value="None">None</option>
      {% for u in non_members %}
         <option value="{{u}}">{{u}}</option>
      {% endfor %}
      </select>
      <br><input type="submit" value="Done"/>
<h2><a href="/admin/project/manage/">Manage projects</h2>
{% else %}
   <h1>Manage Projects</h1>
   <h2>Select Project</h2>
   {% if project_list %}
      {% for p in project_list %}
         <li><a href="?project={{p}}">Project {{p}}</a>
      {% endfor %}
   {% else %}
      <li>Sorry, no projects to manage.
   {% endif %}
   <h2>Create New Project</h2>
      <br><label>New project name</label><input type="text" name="new_project"/>
      <br><input type="submit" value="Done"/> 
{% endif %}
</form>

<br>
<br><a href="/accounts/profile/">Do some other RAT task

